﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace InfoGenerateSystem.Component
{
    /// <summary>
    /// GridControl绑定DataSet生成表图类
    /// 
    /// 创建人:     王昊
    /// 创建时间:   2009-06-18
    /// 
    /// </summary>
    public partial class frmGridToImage : Form
    {
        public frmGridToImage()
        {
            InitializeComponent();
        }

        public DevExpress.XtraGrid.GridControl BindDataAndGetGrid(DataSet ds) 
        {
            gridView1.Columns.Clear();
            gcData.DataSource = ds.Tables[0].DefaultView;

            //foreach (DevExpress.XtraGrid.Columns.GridColumn col in gridView1.Columns)
            //{
            //    col.BestFit();
            //}

            return gcData;
        }
    }
}
